<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'basic',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'backend\controllers',
    'bootstrap' => ['log'],
    'defaultRoute' => 'login',
    //'defaultRoute'=>'login',//修改默认控制器
    'components' => [
        /*'session' => [
            'class' => 'yii\web\Session',
            'timeout' =>60,
        ],*/
        /*'urlManager' => [
            'enablePrettyUrl' => true,//启用美化
            'showScriptName' => false,//隐藏index.php
            'enableStrictParsing' =>false,//关闭严格路径
            //'suffix' => ".html",//这里是伪静态
//            'rules' => [//这里是各种规则还没有研究明白
//                'posts' => 'post/index',
//                'post/<id:\d+>' => 'post/view',
//                '<controller:(post|comment)>/<id:\d+>/<action:(create|update|delete)>' => '<controller>/<action>',
//                'DELETE <controller:\w+>/<id:\d+>' => '<controller>/delete',
//                'http://<user:\w+>.digpage.com/<lang:\w+>/profile' => 'user/profile',
//            ]
        ],*/
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            //这里可以自定义错误页面处理控制器
            'errorAction' => 'test/index',
        ],
    ],
    'params' => $params,
];
